//
// Created by wangwanlong on 2024/6/12.
//

#ifndef MCGPP_CONTEXT_H
#define MCGPP_CONTEXT_H
#include <string>
#include "config.h"
#include "context_enum_classes.h"
namespace mcgpp{
  class PartitionResult{
  public:
    double best_time; //找到最优解的时间
    double total_time;// 总运行时间
    double conductance;// 最优电导
    double init_conductance;//初始电导
    std::vector<IDType>result;

  };
  //缩合参数
  class CoarsenParam{
  public:
    NodeWeightMetric nodeWeightMetric;//顶点的权重配置
  };

  //局部搜索参数
  struct LocalSearchParameters{
    //模拟退火
    struct SA{
      double t0;//初始温度
      double cr = 0.98;//冷却

    };
    //禁忌搜索
    struct TA{
      int max_iter = 10000;//连续未改进的最大迭代数
      int alfa = 80;//禁忌周期管理因子
    };

    TA ta;
    SA sa;

  };

  class Context{
  public:
    static Context& instance(){
      static Context context;
      return  context;
    }

    Context(){

    }



    CoarsenParam coarsenParam;
    LocalSearchParameters localSearchParameters;//局部搜索
    ObjMetric objMetric;
    PartitionResult partitionResult;
    std::string instance_file;
    std::string instance_name;
    std::string seed_partition_file;
    std::string output_dir = "myResult";//保存结果目录
    int seed = -1;
    int coarsen_limit; // 缩合顶点数量限制
    int run_time;
  };
}
#endif //MCGPP_CONTEXT_H
